home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: natlab.research.philips.com!ijntema
- From: ijntema@natlab.research.philips.com (Hans IJntema)
- Subject: Re: Borland C++ floating point overflow - Help!
- Sender: news@natlab.research.philips.com (USENET News System)
- Message-ID: <ijntema.236.01B6FB8D@natlab.research.philips.com>
- Date: Thu, 15 Feb 1996 15:32:49 GMT
- References: <4febl6$5ei@news.acns.nwu.edu> <4fruk3$73t@adam.telalink.net>
- Organization: Philips Research
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
-
- In article <4fruk3$73t@adam.telalink.net> daver@nashville.net (David Rawle) writes:
- >From: daver@nashville.net (David Rawle)
- >Subject: Re: Borland C++ floating point overflow - Help!
- >Date: 14 Feb 1996 06:14:27 GMT
-
- >In article <4febl6$5ei@news.acns.nwu.edu>, msypherd@merle.acns.nwu.edu
- >says...
- >>
- >>Thanks for helping -
- >>
- >> I am runing Borland 4.51 / 4.52 on my P90/16MB with a Gigabyte
- >>motherboard and Award BIOS 4.50<something>. I am having problems simply
- >>entering a floating point number. Every time I do, I get "Floating
- >Point:
- >>Overflow"
- >>
- >>For example,
- >>
- >>#include <iostream.h>
- >>main()
- >>{
- >> float x;
- >> cin >> x;
- >> cout << "It doesn't make it this far when I run it";
- >> reutrn 0;
- >>}
- >>
- >> The program compiles fine, but when I run it, I run into
- >problems. If
- >>I enter a floating point number, I get the error and the program quits.
- >If I
- >>enter an int into the float variable 'x', everything works fine.
-
-
-
- Add somewher a float calculation, e.g. float a = 1.0/2.0;
- Borland C sometimes 'forget' (or optimizes too much) to link the floating
- point lib when you are not using float calculations. For reading a float from
- standard input it needs the float lib, which is not linked......
-
-
-
-
- >> Also, if I put a floating point number into an int variable,
- >instead
- >>of discarding the decimal part, I get a a bizzarre looping of output
- >statments
- >>that lock up the program.
- >>
- >> Is this a problem with my Computer, or do I have some setting set
- >>incorrectly? Any help would be appreciated.
- >>
- >> I'd rather not pay the 900 number fees for Borland tech support.
- > I
- >>think the should at least help me get the program running for the price I
- >>paid. Maybe I'm just an optimist.
- >>
- >> Thanks again,
- >>
- >> Matthew C. Sypherd
- >> ------------------
- >> msypherd@nwu.edu
- >>
- >>p.s. If you could, please post and e-mail any reply - in case I miss the
- >>header.
-
-
- >How are you building this project? You might need to call
- >_InitEasyWin() first thing in main to initialize stdio. What is the
- >value you are trying to enter?
-
-
- ___________________________________________________________________________
- Hans IJntema
- Philips Research
- Building WO-02
- Prof. Holstlaan 4
- 5656 AA Eindhoven
- The Netherlands
-
- e-mail: ijntema@natlab.research.philips.com
- Phone: +31 40 2743325 or 2742877
- Fax: +31 40 2742630
- ___________________________________________________________________________
-